using Gtk;
using WebKit;

namespace Atlantis
{
	public class BrowserView : GLib.Object, IWidgetProvider, ISmartPartInfoProvider
	{
		ScrolledWindow scrolledWindow;
		WebView htmlWidget;
			
		construct
		{
			this.scrolledWindow = new ScrolledWindow (null, null);
			this.htmlWidget = new WebView();
			scrolledWindow.set_policy (PolicyType.AUTOMATIC, PolicyType.AUTOMATIC);
			scrolledWindow.add (this.htmlWidget);
			scrolledWindow.show_all();
		}
		
		public void Open(string uri)
		{
			this.htmlWidget.open(uri);
		}
			
		public ISmartPartInfo GetSmartPartInfo()
		{
			stderr.printf("GetSmartPartInfo()");
			var ret = new SmartPartInfo();
			ret.Label = "Welcome";
			return ret;
		}
			
		public Widget Widget
		{
			get
			{
				return scrolledWindow;
			}
		}
	}
}
